package com.canaan.business.common.enums.storehouse;

import com.canaan.common.utils.StringUtils;

public enum StorehouseStockCheckStatusEnum {
    TO_BE_INSPECTED("1", "待检"),
    INSPECTED_QUALIFIED("2", "已检合格"),
    INSPECTED_CONCESSION("3", "已检让步"),
    INSPECTED_PART("4", "已检部分"),
    INSPECTED_RETURN("5", "退货");
    private final String code;
    private final String message;

    StorehouseStockCheckStatusEnum(String code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getCodeByMessage(String message){
        for(StorehouseStockCheckStatusEnum statusEnum: StorehouseStockCheckStatusEnum.values()){
            if(StringUtils.isEmpty(message)){
                return null;
            }
            if(message.equals(statusEnum.code)){
                return statusEnum.message;
            }
        }
        return null;
    }
}
